﻿using System.Collections.Generic;

namespace Sgr.AspNetCore
{
    /// <summary>
    /// CORS 配置选项
    /// </summary>
    public class CorsSettings
    {
        /// <summary>
        /// 是否启用CORS
        /// </summary>
        public bool EnableCors { get; set; }

        /// <summary>
        /// 允许的来源
        /// </summary>
        public List<string> AllowedOrigins { get; set; } = new();

        /// <summary>
        /// 允许的HTTP方法
        /// </summary>
        public List<string> AllowedMethods { get; set; } = new();

        /// <summary>
        /// 允许的请求头
        /// </summary>
        public List<string> AllowedHeaders { get; set; } = new();

        /// <summary>
        /// 是否允许携带凭证
        /// </summary>
        public bool AllowCredentials { get; set; }
    }
}